#include <goocanvas.h>

typedef struct _Button{
	gdouble x;
	gdouble y;
	gdouble width;
	gdouble height;
	int icon_area;
	
	gboolean focus;
	
	//button's Object
	GooCanvasItem *parent;
	GooCanvasItem *cavas;

	//child Object
	GooCanvasItem *background;
	GooCanvasItem *foreground;
	GooCanvasItem *text;
	GooCanvasItem *icon_bg;
	GooCanvasItem *icon_fg;
	
	Theme *theme;
	
	//button's function
	gboolean (*clicked_func)(struct _Button *Button,gpointer);
}Button;

Button *button_new(GooCanvasItem * parent,int x,int y,Theme *theme);
Button *button_new_with_text(GooCanvasItem * parent,int x,int y,Theme *theme,const char *text);
void button_destroy(Button *button);

void button_set_propertie(Button *button,const char *key,gpointer data);
void button_set_func(Button *button,const char *key,gboolean (*func)(Button *button,gpointer data),gpointer user_data);
void button_set_focus(Button *button,gboolean focus);
void button_set_text(Button *button ,const char *text);
void button_set_icon(Button *button,GdkPixbuf *fg,GdkPixbuf *bg);
void button_set_ground(Button *button,GdkPixbuf *fg,GdkPixbuf *bg);
void button_set_size(Button *button,int width,int height);

gboolean button_get_focus(Button *button);
const char *button_get_text(Button * button);

gboolean button_click(Button *button);
